from OpenGL.GLUT import *; from OpenGL.GL import *
from OpenGL.GL.ARB.shader_objects import *
from OpenGL.GL.ARB.fragment_shader import *
from OpenGL.GL.ARB.vertex_shader import *
import sys

def init(width, height):
    # creating a rendering context
    glutInit(sys.argv)
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH)
    glutInitWindowSize(width, height)
    glutCreateWindow("Shader-Test")

    # checking wether system supports ARB_(fragment, vertex)_program extension
    if not glInitShaderObjectsARB():

        raise RuntimeError(
            """ARB Shader Objects extension is required """
            """but not supported on this machine!""" )
